package com.sac.approval.service.impl;

import com.sac.approval.dao.ApprovalQueryDao;
import com.sac.approval.domain.ApprovalDO;
import com.sac.approval.domain.ApprovalLineDO;
import com.sac.approval.domain.ApprovalTemplateDO;
import com.sac.approval.service.ApprovalQueryService;
import com.sac.approval.vo.ApprovalVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ApprovalQueryServiceImpl implements ApprovalQueryService {
	@Autowired
	private ApprovalQueryDao approvalQueryDao;


	
	@Override
	public ApprovalDO getApproval(String appId){
		return approvalQueryDao.getApproval(appId);
	}

	@Override
	public ApprovalTemplateDO getApprovalTemplate(String appTemplateId) {
		return approvalQueryDao.getApprovalTemplate(appTemplateId);
	}

	@Override
	public ApprovalLineDO getApprovalLine(String appLineId) {
		return approvalQueryDao.getApprovalLine(appLineId);
	}

    @Override
    public ApprovalLineDO getApprovalDraft(String appId) {
        return approvalQueryDao.getApprovalDraft(appId);
    }

    @Override
	public ApprovalLineDO getFirstApprovalLine(String appId) {
		return approvalQueryDao.getFirstApprovalLine(appId);
	}

	@Override
	public List<ApprovalLineDO> getPendingApproverList(String appId) {
		return approvalQueryDao.getPendingApproverList(appId);
	}

	/**
	 * 获取待审批者列表，不包括后批者
	 * @param appId
	 * @return
	 */
	@Override
	public List<ApprovalLineDO> getPendingSimpleApproverList(String appId) {
		return approvalQueryDao.getPendingSimpleApproverList(appId);
	}

	@Override
	public List<ApprovalLineDO> listLines(Map<String, Object> map) {
		return approvalQueryDao.listLines(map);
	}

	@Override
	public List<ApprovalVO> listPending(Map<String, Object> map) {
		return approvalQueryDao.listPending(map);
	}

	@Override
	public int getPendingNotReadCount(Map<String, Object> map) {
		return approvalQueryDao.getPendingNotReadCount(map);
	}

	@Override
	public List<ApprovalDO> listSubmission(Map<String, Object> map) {
		return approvalQueryDao.listSubmission(map);
	}

	@Override
	public List<ApprovalTemplateDO> listPostponed(Map<String, Object> map) {
		return approvalQueryDao.listPostponed(map);
	}

	@Override
	public List<ApprovalVO> listPreliminary(Map<String, Object> map) {
		return approvalQueryDao.listPreliminary(map);
	}

	@Override
	public List<ApprovalVO> listApproved(Map<String, Object> map) {
		return approvalQueryDao.listApproved(map);
	}

	@Override
	public List<ApprovalVO> listNotification(Map<String, Object> map) {
		return approvalQueryDao.listNotification(map);
	}

}
